package fr.bda.cloud.storage;

import javax.xml.bind.annotation.XmlRootElement;

import fr.bda.cloud.storage.StorageUnitType;

@XmlRootElement
public abstract class StorageUnitConfiguration {

	private StorageUnitType storageUnitType;

	public StorageUnitConfiguration() {

	}

	public StorageUnitConfiguration(StorageUnitType storageUnitType) {
		this.storageUnitType = storageUnitType;
	}

	public StorageUnitType getStorageUnitType() {
		return storageUnitType;
	}

	public void setStorageUnitType(StorageUnitType storageUnitType) {
		this.storageUnitType = storageUnitType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((storageUnitType == null) ? 0 : storageUnitType.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		StorageUnitConfiguration other = (StorageUnitConfiguration) obj;
		if (storageUnitType != other.storageUnitType)
			return false;
		return true;
	}
	
	
	@Override
	public String toString() {
		return this.getClass().getSimpleName();
	}

}
